Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Printing /
Chapter 4 - Advanced Printing Features / Advanced Printing Features Reference
Functions / Working With QuickDraw GX Print Files


GXOpenPrintFile

You can use the GXOpenPrintFile function to open a print file.

gxPrintFile GXOpenPrintFile (gxJob aPrintFileJob, 
                              FSSpecPtr pFileSpec, 
                              char permission);
aPrintFileJob
A reference to the job object to associate with a particular printer file.
pFileSpec
A pointer to a file system specification.
permission

The access privileges to use when opening the print file object.
function result
A reference to a print file object.
DESCRIPTION
The GXOpenPrintFile function attempts to open the print file specified by a pointer to a file system specification record, pFileSpec. If successful, the function returns a print file object that represents the file. The permission parameter specifies the access privileges, which can be read-only or read-and-write access.

The information for the print file's job object is unflattened into the job object you specify in the aPrintFileJob parameter. This job object specified in the parameter remains associated with the print file until you close the file by calling the GXClosePrintFile function.

To check for errors, you should call the GXGetJobError function with the specified job object following calls that operate on the print file.

SPECIAL CONSIDERATIONS
The GXOpenPrintFile function sets up a warning handler, which chains to the application's warning handler, if it exists. For more information about warning handlers, see the errors, warnings, and notices chapter of Inside Macintosh: QuickDraw GX Environment and Utilities.

RESULT CODES
gxSegmentLoadFailedErrA required code segment could not be found, or there was not enough memory to load it.
gxIncompletePrintFileErrContents of file are incomplete.
gxCrashedPrintFileErrFile is currently printing or crashed while printing.
gxInvalidPrintFileVersionCannot read file due to incompatible file version.
gxFlattenVersionTooNewAn attempt was made to unflatten a job object that was flattened using a later version of QuickDraw GX.
collectionVersionErrThe version of the collection object is not compatible with the current version of the Collection Manager.
SEE ALSO
For an example that uses the GXOpenPrintFile function, see "Opening and Closing a Print File" on page 4-29.

To close a print file object, you use the GXClosePrintFile function, which is described in the next section.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help